angular.module("app.sys").register.controller("ListMobileCtrl", ["$scope", "$http", "$state", "$modal", "$modalService", function($scope, $http, $state, $modal, $modalService){
  $scope.stores = [];
  $scope.loadTip = '请输入查询号码...........';
  $scope.filter = {
    mobile: ''
  }
  $scope.gets = function(){
    $scope.loadTip = '正在获取数据...........';
    $scope.stores = [];
    $http.post('/sys/mobile/gets/', {
      mobile: $scope.filter.mobile
    }, {
      transformRequest: function(data){
        return $.param(data);
      }
    }).success(function(ret){
      if(ret.status){
        $scope.stores = ret.data;
        $scope.stores.length == 0 ? $scope.loadTip = '没有找到相关数据...........' : '';
      }else{
        $modalService.myAlert(ret.data);
      }
    }).error(function(){
      $modalService.myAlert('系统错误，请求资源失败！');
    });
  };
  $scope.refresh = function(){
    $scope.stores = [];
    $scope.gets();
  };
  $scope.search = function(){
    $scope.refresh();
  }
}]);